using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_PatientProgressMap : EntityTypeConfiguration<SO_PatientProgress>
    {
        public SO_PatientProgressMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.Current });

            // Properties
            this.Property(t => t.admission_id)
                .HasMaxLength(10);

            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.Case__)
                .HasMaxLength(15);

            this.Property(t => t.Latin_Name)
                .HasMaxLength(30);

            this.Property(t => t.Arabic_Name)
                .HasMaxLength(30);

            this.Property(t => t.C_Track_Number)
                .HasMaxLength(20);

            this.Property(t => t.Phones)
                .HasMaxLength(30);

            this.Property(t => t.ADDRESS)
                .HasMaxLength(80);

            this.Property(t => t.Current)
                .IsRequired()
                .HasMaxLength(4);

            // Table & Column Mappings
            this.ToTable("SO_PatientProgress");
            this.Property(t => t.admission_id).HasColumnName("admission_id");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Case__).HasColumnName("Case #");
            this.Property(t => t.Latin_Name).HasColumnName("Latin_Name");
            this.Property(t => t.Arabic_Name).HasColumnName("Arabic_Name");
            this.Property(t => t.C_Track_Number).HasColumnName(" Track Number");
            this.Property(t => t.Phones).HasColumnName("Phones");
            this.Property(t => t.ADDRESS).HasColumnName("ADDRESS");
            this.Property(t => t.Current).HasColumnName("Current");
        }
    }
}
